package com.cetc39.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.cetc39.bean.LifeCycle;
import com.cetc39.dao.LifeCycleDao;

public class LifeCycleDaoImpl extends HibernateDaoSupport implements LifeCycleDao {

	@Override
	public void save(LifeCycle lc) {
		this.getHibernateTemplate().save(lc);
	}

	@Override
	public void update(LifeCycle lc) {
		this.getHibernateTemplate().saveOrUpdate(lc);
	}

	@Override
	public List<?> findAll() {
		return this.getHibernateTemplate().find("FROM LifeCycle");
	}

	@Override
	public LifeCycle findById(int id) {
		return this.getHibernateTemplate().get(LifeCycle.class, id);
	}

	@Override
	public void delete(int id) {
		LifeCycle lc = this.getHibernateTemplate().get(LifeCycle.class, id);
		this.getHibernateTemplate().delete(lc);
	}

}
